<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>营脚煤矿高位钻孔数据分析</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #0c1c29, #1e3c5a);
            color: #e0e0e0;
            min-height: 100vh;
            padding: 20px;
            background-attachment: fixed;
        }
        
        .container {
            max-width: 1600px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 25px;
        }
        
        .header {
            background: linear-gradient(135deg, #1a2a3a, #203a52);
            color: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
            text-align: center;
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .header::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(52, 152, 219, 0.15) 0%, rgba(255,255,255,0) 70%);
            transform: rotate(30deg);
        }
        
        .header h1 {
            font-size: 2.8rem;
            margin-bottom: 15px;
            font-weight: 700;
            letter-spacing: 1px;
            position: relative;
            z-index: 2;
            text-shadow: 0 2px 10px rgba(0,0,0,0.5);
        }
        
        .header p {
            font-size: 1.2rem;
            opacity: 0.9;
            max-width: 1000px;
            margin: 0 auto;
            position: relative;
            z-index: 2;
            line-height: 1.7;
        }
        
        .card {
            background: rgba(30, 45, 62, 0.85);
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
            padding: 25px;
            transition: all 0.4s ease;
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(5px);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
        }
        
        .card::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c);
        }
        
        .controls {
            display: flex;
            flex-wrap: wrap;
            gap: 20px;
            align-items: center;
            justify-content: center;
            margin-bottom: 25px;
        }
        
        .control-group {
            display: flex;
            flex-direction: column;
            min-width: 250px;
            background: rgba(35, 55, 75, 0.6);
            padding: 15px;
            border-radius: 12px;
            box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .control-group label {
            font-weight: 600;
            margin-bottom: 8px;
            color: #a0d2ff;
            font-size: 1.05rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        select, input {
            padding: 12px 18px;
            border-radius: 10px;
            border: 1px solid #3a5a77;
            background-color: rgba(25, 40, 55, 0.8);
            color: #f0f0f0;
            font-size: 1rem;
            min-width: 100%;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        
        select:focus, input:focus {
            outline: none;
            border-color: #3498db;
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
        }
        
        .date-range {
            display: flex;
            gap: 15px;
            align-items: center;
        }
        
        .date-range input {
            min-width: 180px;
        }
        
        .btn-apply {
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 10px;
            font-size: 1.05rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .btn-apply:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 20px rgba(52, 152, 219, 0.7);
            background: linear-gradient(135deg, #2980b9, #3498db);
        }
        
        .summary {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 20px;
            margin-top: 15px;
        }
        
        .metric-box {
            background: linear-gradient(135deg, #2c3e50, #1a2a3a);
            color: white;
            padding: 20px;
            border-radius: 12px;
            text-align: center;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .metric-box:nth-child(1) {
            background: linear-gradient(135deg, #3498db, #1a5a8a);
        }
        
        .metric-box:nth-child(2) {
            background: linear-gradient(135deg, #2ecc71, #27ae60);
        }
        
        .metric-box:nth-child(3) {
            background: linear-gradient(135deg, #9b59b6, #8e44ad);
        }
        
        .metric-box:nth-child(4) {
            background: linear-gradient(135deg, #f1c40f, #f39c12);
        }
        
        .metric-box:nth-child(5) {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
        }
        
        .metric-box:nth-child(6) {
            background: linear-gradient(135deg, #1abc9c, #16a085);
        }
        
        .metric-box:hover {
            transform: scale(1.03);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        }
        
        .metric-value {
            font-size: 2.2rem;
            font-weight: bold;
            margin: 15px 0;
            text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        }
        
        .metric-label {
            font-size: 1.1rem;
            opacity: 0.9;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .charts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
            gap: 25px;
        }
        
        .chart-title {
            text-align: center;
            font-weight: 700;
            margin-bottom: 20px;
            color: #a0d2ff;
            font-size: 1.4rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        .chart-container {
            height: 350px;
            position: relative;
        }
        
        .data-table-container {
            overflow-x: auto;
            margin-top: 15px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        }
        
        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 0;
            min-width: 1000px;
        }
        
        .data-table th {
            background: linear-gradient(135deg, #2c3e50, #1a2a3a);
            color: white;
            padding: 16px;
            text-align: left;
            font-weight: 600;
            position: sticky;
            top: 0;
            border-bottom: 2px solid #3498db;
        }
        
        .data-table td {
            padding: 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            color: #e0e0e0;
        }
        
        .data-table tr:nth-child(even) {
            background-color: rgba(30, 45, 60, 0.5);
        }
        
        .data-table tr:hover {
            background-color: rgba(52, 152, 219, 0.15);
        }
        
        .info-text {
            background: linear-gradient(135deg, rgba(30, 50, 70, 0.8), rgba(25, 40, 55, 0.8));
            padding: 22px;
            border-radius: 12px;
            font-size: 1.05rem;
            color: #a0d2ff;
            margin-top: 15px;
            border-left: 5px solid #3498db;
        }
        
        .info-text p {
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .info-text i {
            min-width: 24px;
            text-align: center;
            color: #3498db;
        }
        
        h3 {
            color: #a0d2ff;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.5rem;
        }
        
        .drill-id {
            background: #3498db;
            color: white;
            padding: 5px 15px;
            border-radius: 20px;
            font-weight: 600;
            letter-spacing: 1px;
        }
        
        .highlight-row {
            background-color: rgba(231, 76, 60, 0.2) !important;
        }
        
        .highlight-row:hover {
            background-color: rgba(231, 76, 60, 0.3) !important;
        }
        
        .status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 20px;
            background: rgba(20, 35, 50, 0.8);
            border-radius: 10px;
            margin-top: 15px;
            font-size: 0.95rem;
        }
        
        .last-updated {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #a0d2ff;
        }
        
        .red-text {
            color: #e74c3c;
            font-weight: bold;
        }
        
        .status-tag {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 0.85rem;
            font-weight: bold;
        }
        
        .status-normal {
            background-color: rgba(46, 204, 113, 0.2);
            color: #2ecc71;
        }
        
        .status-warning {
            background-color: rgba(241, 196, 15, 0.2);
            color: #f1c40f;
        }
        
        .status-danger {
            background-color: rgba(231, 76, 60, 0.2);
            color: #e74c3c;
        }
        
        @media (max-width: 1400px) {
            .summary {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        
        @media (max-width: 1200px) {
            .charts-grid {
                grid-template-columns: 1fr;
            }
        }
        
        @media (max-width: 900px) {
            .summary {
                grid-template-columns: repeat(2, 1fr);
            }
            
            .header h1 {
                font-size: 2.2rem;
            }
        }
        
        @media (max-width: 768px) {
            .controls {
                flex-direction: column;
            }
            
            .control-group {
                width: 100%;
            }
            
            .date-range {
                flex-direction: column;
                width: 100%;
            }
            
            .header h1 {
                font-size: 1.8rem;
            }
            
            .header p {
                font-size: 1rem;
            }
            
            .summary {
                grid-template-columns: 1fr;
            }
        }
        
        .system-status {
            display: flex;
            justify-content: center;
            gap: 20px;
            margin-top: 10px;
        }
        
        .status-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 15px;
            background: rgba(30, 50, 70, 0.6);
            border-radius: 20px;
            font-size: 0.9rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }
        
        .status-online {
            background-color: #2ecc71;
        }
        
        .status-offline {
            background-color: #e74c3c;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1></i> 营脚煤矿12802高位钻孔数据分析系统</h1>
            <p>选择钻孔并指定日期范围查看负压、瓦斯浓度和混合流量的变化曲线 | 数据更新至今日</p>
            <div class="system-status">
                <div class="status-item">
                    <i class="fas fa-database"></i>
                    <span>数据最后更新: <span id="last-update">2025-06-22</span></span>
                </div>
                <div class="status-item">
                    <i class="fas fa-exclamation-triangle"></i>
                    <span>今日瓦斯浓度超30%的钻孔: <span id="exceed-count">3</span></span>
                </div>
            </div>
        </div>
        
        <div class="card">
            <div class="controls">
                <div class="control-group">
                    <label for="drill-select"><i class="fas fa-hammer"></i> 选择钻孔</label>
                    <select id="drill-select">
                        <option value="A1">A1</option>
                        <option value="A2" selected>A2</option>
                        <option value="A3">A3</option>
                        <option value="A4">A4</option>
                        <option value="A5">A5</option>
                        <option value="A6">A6</option>
                        <option value="A7">A7</option>
                        <option value="A8">A8</option>
                        <option value="E1">E1</option>
                        <option value="E2">E2</option>
                        <option value="E3">E3</option>
                        <option value="E4">E4</option>
                        <option value="E5">E5</option>
                        <option value="E6">E6</option>
                        <option value="E7">E7</option>
                        <option value="E8">E8</option>
                        <option value="F1">F1</option>
                        <option value="F2">F2</option>
                        <option value="F3">F3</option>
                        <option value="F4">F4</option>
                        <option value="F5">F5</option>
                        <option value="F6">F6</option>
                        <option value="F7">F7</option>
                        <option value="F8">F8</option>
                        <option value="G1">G1</option>
                        <option value="G2">G2</option>
                        <option value="G3">G3</option>
                        <option value="G4">G4</option>
                        <option value="G5">G5</option>
                        <option value="G6">G6</option>
                        <option value="G7">G7</option>
                        <option value="G8">G8</option>
                    </select>
                </div>
                
                <div class="control-group">
                    <label for="start-date"><i class="far fa-calendar-alt"></i> 日期范围</label>
                    <div class="date-range">
                        <input type="date" id="start-date" value="2025-05-01">
                        <span>至</span>
                        <input type="date" id="end-date" value="2025-06-22">
                    </div>
                </div>
                
                <button id="apply-date" class="btn-apply">
                    <i class="fas fa-sync-alt"></i> 应用筛选
                </button>
            </div>
            
            <div class="summary">
                <div class="metric-box">
                    <div class="metric-label"></i> 平均负压</div>
                    <div class="metric-value">5.32 KPa</div>
                </div>
                <div class="metric-box">
                    <div class="metric-label"></i> 平均瓦斯浓度</div>
                    <div class="metric-value">42.5%</div>
                </div>
                <div class="metric-box">
                    <div class="metric-label"></i> 平均混合流量</div>
                    <div class="metric-value">0.218 m³/min</div>
                </div>
                <div class="metric-box">
                    <div class="metric-label"></i> 始抽浓度</div>
                    <div class="metric-value">90.5%</div>
                </div>
                <div class="metric-box">
                    <div class="metric-label"></i> 历史最高浓度</div>
                    <div class="metric-value">92.9%</div>
                </div>
                <div class="metric-box">
                    <div class="metric-label"></i> 历史最低浓度</div>
                    <div class="metric-value">6.6%</div>
                </div>
            </div>
        </div>
        
        <div class="charts-grid">
            <div class="card">
                <div class="chart-title"><span class="drill-id">A2</span> </i> 负压变化曲线 (KPa)</div>
                <div class="chart-container">
                    <canvas id="pressure-chart"></canvas>
                </div>
            </div>
            <div class="card">
                <div class="chart-title"><span class="drill-id">A2</span> </i> 瓦斯浓度变化曲线 (%)</div>
                <div class="chart-container">
                    <canvas id="concentration-chart"></canvas>
                </div>
            </div>
            <div class="card">
                <div class="chart-title"><span class="drill-id">A2</span> </i> 混合流量变化曲线 (m³/min)</div>
                <div class="chart-container">
                    <canvas id="flow-chart"></canvas>
                </div>
            </div>
        </div>
        
        <div class="card">
            <h3><i class="fas fa-table"></i> 钻孔详细数据 - <span class="drill-id">A2</span></h3>
            <div class="data-table-container">
                <table class="data-table">
                    <thead>
                        <tr>
                            <th>检测日期</th>
                            <th>钻孔编号</th>
                            <th>方位 (°)</th>
                            <th>倾角 (°)</th>
                            <th>孔深 (m)</th>
                            <th>负压 (KPa)</th>
                            <th>瓦斯浓度 (%)</th>
                            <th>混合流量 (m³/min)</th>
                        </tr>
                    </thead>
                    <tbody id="data-table-body">
                        <!-- 数据将通过JS填充 -->
                    </tbody>
                </table>
            </div>
        </div>
        
        <div class="card">
            <h3><i class="fas fa-exclamation-triangle"></i> 今日瓦斯浓度超过30%的钻孔</h3>
            <div class="data-table-container">
                <table class="data-table">
                    <thead>
                        <tr>
                            <th>钻孔编号</th>
                            <th>瓦斯浓度 (%)</th>
                            <th>检测日期</th>
                            <th>状态</th>
                        </tr>
                    </thead>
                    <tbody id="high-concentration-table-body">
                        <!-- 数据将通过JS填充 -->
                    </tbody>
                </table>
            </div>
        </div>
        <div class="info-text">
            <strong><i class="fas fa-info-circle"></i> 使用说明：</strong>
            <p><i class="fas fa-check"></i> 从顶部下拉菜单中选择要分析的钻孔编号</p>
            <p><i class="fas fa-check"></i> 设置起始日期和终止日期筛选特定时间段的数据</p>
            <p><i class="fas fa-check"></i> 点击"应用筛选"按钮更新图表和表格数据</p>
            <p><i class="fas fa-check"></i> 图表实时显示选定钻孔的负压、浓度和流量变化曲线</p>
            <p><i class="fas fa-check"></i> 表格中显示详细数据，包含钻孔编号、检测日期和各参数值</p>
            <p><i class="fas fa-check"></i> 顶部指标卡显示关键数据的统计指标，包括新增的始抽浓度和历史最低浓度</p>
            <p><i class="fas fa-check"></i> 今日瓦斯浓度超过30%的钻孔编号已标红显示</p>
        </div>
        <div class="container"></i> 营脚煤矿通防科</h1></div>
    </div>

    <script>
        // 模拟数据（扩展了更多钻孔和更多数据点）
        const drillData = {
            A1: {
                azimuth: 53,
                dip: 24,
                depth: 35,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.25,5.52,5.73,5.72],
                concentration: [83.36,76.31,72.62,74.55],
                flow: [0.200,0.242,0.515,0.878]
            },
            A2: {
                azimuth: 68,
                dip: 24,
                depth: 40,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.23,5.43,5.40,5.46],
                concentration: [90.50,75.74,86.40,61.76],
                flow: [0.103,0.260,0.472,0.898]
            },
            A3: {
                azimuth: 81,
                dip: 24,
                depth: 42,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.24,5.50,5.68,5.60],
                concentration: [90.06,6.60,1.03,0.75],
                flow: [0.146,0.219,0.492,0.897]
            },
            A4: {
                azimuth: 91,
                dip: 24,
                depth: 48,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.21,5.57,5.54,5.54],
                concentration: [1.99,0.43,0.68,0.44],
                flow: [0.114,0.249,0.492,0.879]
            },
            A5: {
                azimuth: 99,
                dip: 24,
                depth: 58,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.23,5.52,5.52,5.57],
                concentration: [1.35,0.54,0.58,0.42],
                flow: [0.123,0.208,0.499,0.892]
            },
            A6: {
                azimuth: 105,
                dip: 24,
                depth: 64,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.19,5.41,5.40,5.26],
                concentration: [1.33,0.40,0.32,0.42],
                flow: [0.212,0.244,0.456,0.917]
            },
            A7: {
                azimuth: 110,
                dip: 24,
                depth: 71,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.19,5.61,5.62,5.64],
                concentration: [1.00,0.25,0.28,0.34],
                flow: [0.178,0.253,0.504,0.885]
            },
            A8: {
                azimuth: 114,
                dip: 24,
                depth: 40,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.24,5.57,5.44,5.41],
                concentration: [0.55,0.16,0.14,0.21],
                flow: [0.236,0.265,0.509,0.883]
            },
            E1: {
                azimuth: 53,
                dip: 24,
                depth: 40,
                dates: ['2025-06-23'],
                pressure: [5.51],
                concentration: [0.15],
                Elow: [0.638]
            },
            E2: {
                azimuth: 68,
                dip: 24,
                depth: 41,
                dates: ['2025-06-23'],
                pressure: [5.59],
                concentration: [25.02],
                flow: [0.643]
            },
            E3: {
                azimuth: 81,
                dip: 24,
                depth: 46,
                dates: ['2025-06-23'],
                pressure: [5.43],
                concentration: [0.34],
                flow: [0.543]
            }, 
            E4: {
                azimuth: 91,
                dip: 24,
                depth: 50,
                dates: ['2025-06-23'],
                pressure: [5.27],
                concentration: [0.30],
                flow: [0.563]
            },
            E5: {
                azimuth: 99,
                dip: 24,
                depth: 54,
                dates: ['2025-06-23'],
                pressure: [5.26],
                concentration: [0.26],
                flow: [0.521]
            },
            E6: {
                azimuth: 105,
                dip: 24,
                depth: 62,
                dates: ['2025-06-23'],
                pressure: [5.55],
                concentration: [0.20],
                flow: [0.499]
            },
            E7: {
                azimuth: 110,
                dip: 24,
                depth: 72,
                dates: ['2025-06-23'],
                pressure: [5.46],
                concentration: [0.16],
                flow: [0.582]
            },
            E8: {
                azimuth: 114,
                dip: 24,
                depth: 80,
                dates: ['2025-06-23'],
                pressure: [5.27],
                concentration: [0.17],
                flow: [0.568]
            },
            F1: {
                azimuth: 53,
                dip: 24,
                depth: 40,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.24,5.41,5.60,5.45],
                concentration: [0.72,0.20,0.17,0.23],
                flow: [0.168,0.251,0.508,0.564]
            },
            F2: {
                azimuth: 68,
                dip: 24,
                depth: 41,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.17,5.39,5.53,5.28],
                concentration: [6.59,0.58,6.83,5.74],
                flow: [0.244,0.231,0.472,0.542]
            },
            F3: {
                azimuth: 81,
                dip: 24,
                depth: 46,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.18,5.59,5.77,5.50],
                concentration: [92.23,82.71,81.50,85.03],
                flow: [0.235,0.253,0.521,0.542]
            }, 
            F4: {
                azimuth: 91,
                dip: 24,
                depth: 50,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.18,5.40,5.53,5.39],
                concentration: [86.70,26.43,29.81,3.77],
                flow: [0.174,0.207,0.459,0.588]
            },
            F5: {
                azimuth: 99,
                dip: 24,
                depth: 54,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.19,5.64,5.57,5.42],
                concentration: [5.59,0.94,3.68,2.67],
                flow: [0.201,0.210,0.58,0.494]
            },
            F6: {
                azimuth: 105,
                dip: 24,
                depth: 62,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.15,5.37,5.52,5.42],
                concentration: [14.60,7.72,7.69,6.81],
                flow: [0.114,0.251,0.520,0.497]
            },
            F7: {
                azimuth: 110,
                dip: 24,
                depth: 72,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.17,5.65,5.52,5.33],
                concentration: [5.90,5.84,5.74,5.56],
                flow: [0.203,0.220,0.470,0.554]
            },
            F8: {
                azimuth: 114,
                dip: 24,
                depth: 80,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.21,5.39,5.65,5.47],
                concentration: [89.80,85.90,89.39,56.96],
                flow: [0.119,0.267,0.500,0.532]
            },
            G1: {
                azimuth: 53,
                dip: 24,
                depth: 38,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.18,5.45,5.73,5.59],
                concentration: [92.93,88.34,88.09,87.95],
                flow: [0.122,0.198,0.502,0.531]
            },
            G2: {
                azimuth: 68,
                dip: 24,
                depth: 40,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.19,5.44,5.48,5.33],
                concentration: [87.66,86.03,86.88,85.75],
                flow: [0.250,0.248,0.488,0.630]
            },
            G3: {
                azimuth: 91,
                dip: 24,
                depth: 41,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.15,5.70,5.60,5.32],
                concentration: [93.13,86.03,77.95,44.18],
                flow: [0.159,0.212,0.506,0.625]
            },
            G4: {
                azimuth: 91,
                dip: 24,
                depth: 47,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.17,5.48,5.40,5.54],
                concentration: [23.33,39.79,29.19,12.93],
                flow: [0.204,0.244,0.510,0.566]
            },
            G5: {
                azimuth: 99,
                dip: 24,
                depth: 54,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.21,5.65,5.67,5.30],
                concentration: [5.00,8.28,4.33,3.49],
                flow: [0.150,0.240,0.495,0.541]
            },
            G6: {
                azimuth: 105,
                dip: 24,
                depth: 64,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.15,5.63,5.60,5.33],
                concentration: [10.45,8.81,9.39,7.64],
                flow: [0.145,0.258,0.488,0.486]
            },
            G7: {
                azimuth: 110,
                dip: 24,
                depth: 74,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.15,5.39,5.56,5.61],
                concentration: [9.01,7.81,8.15,6.77],
                flow: [0.216,0.239,0.502,0.505]
            },
            G8: {
                azimuth: 114,
                dip: 24,
                depth: 79,
                dates: ['2025-06-20','2025-06-21','2025-06-22','2025-06-23'],
                pressure: [5.15,5.69,5.78,5.26],
                concentration: [92.34,85.66,88.67,89.04],
                flow: [0.197,0.233,0.481,0.495]
            },
        };

        // 获取DOM元素
        const drillSelect = document.getElementById('drill-select');
        const startDateInput = document.getElementById('start-date');
        const endDateInput = document.getElementById('end-date');
        const applyBtn = document.getElementById('apply-date');
        const dataTableBody = document.getElementById('data-table-body');
        const highConcentrationTableBody = document.getElementById('high-concentration-table-body');
        const drillIdElements = document.querySelectorAll('.drill-id');
        const lastUpdateElement = document.getElementById('last-update');
        const exceedCountElement = document.getElementById('exceed-count');
        
        // 图表实例
        let pressureChart, concentrationChart, flowChart;
        
        // 获取今天的日期（YYYY-MM-DD格式）
        function getTodayDate() {
            const today = new Date();
            const year = today.getFullYear();
            const month = String(today.getMonth() + 1).padStart(2, '0');
            const day = String(today.getDate()).padStart(2, '0');
            return `${year}-${month}-${day}`;
        }
        
        // 初始化页面
        function initializePage() {
            // 设置默认日期范围
            const today = new Date();
            const oneMonthAgo = new Date();
            oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1);
            
            startDateInput.value = formatDate(oneMonthAgo);
            endDateInput.value = formatDate(today);
            
            // 设置最后更新日期
            lastUpdateElement.textContent = getTodayDate();
            
            // 初始化图表
            updateChartsAndTable();
            
            // 事件监听
            applyBtn.addEventListener('click', updateChartsAndTable);
            drillSelect.addEventListener('change', updateChartsAndTable);
        }
        
        // 日期格式化函数
        function formatDate(date) {
            const year = date.getFullYear();
            const month = String(date.getMonth() + 1).padStart(2, '0');
            const day = String(date.getDate()).padStart(2, '0');
            return `${year}-${month}-${day}`;
        }
        
        // 过滤数据函数
        function filterDataByDateRange(dates, data, startDate, endDate) {
            const filteredDates = [];
            const filteredData = [];
            
            for (let i = 0; i < dates.length; i++) {
                const date = new Date(dates[i]);
                if (date >= startDate && date <= endDate) {
                    filteredDates.push(dates[i]);
                    filteredData.push(data[i]);
                }
            }
            
            return { dates: filteredDates, data: filteredData };
        }
        
        // 获取今日高浓度钻孔数据
        function getTodayHighConcentrationDrills() {
            const highConcentrationDrills = [];
            const today = getTodayDate();
            
            for (const drillId in drillData) {
                const drill = drillData[drillId];
                const lastIndex = drill.dates.length - 1;
                
                // 检查最后一个数据点是否是今天的
                if (drill.dates[lastIndex] === today && drill.concentration[lastIndex] > 30) {
                    highConcentrationDrills.push({
                        drillId,
                        concentration: drill.concentration[lastIndex],
                        date: drill.dates[lastIndex],
                        status: drill.concentration[lastIndex] > 85 ? '严重超标' : 
                               drill.concentration[lastIndex] > 60 ? '超标' : '较高'
                    });
                }
            }
            
            // 按浓度从高到低排序
            highConcentrationDrills.sort((a, b) => b.concentration - a.concentration);
            return highConcentrationDrills;
        }
        
        // 更新图表和表格
        function updateChartsAndTable() {
            const drillId = drillSelect.value;
            const startDate = new Date(startDateInput.value);
            const endDate = new Date(endDateInput.value);
            
            // 更新所有钻孔编号显示
            drillIdElements.forEach(el => {
                el.textContent = drillId;
            });
            
            // 获取当前钻孔数据
            const currentDrillData = drillData[drillId] || drillData.A2;
            
            // 过滤数据
            const pressureData = filterDataByDateRange(
                currentDrillData.dates, 
                currentDrillData.pressure, 
                startDate, 
                endDate
            );
            
            const concentrationData = filterDataByDateRange(
                currentDrillData.dates, 
                currentDrillData.concentration, 
                startDate, 
                endDate
            );
            
            const flowData = filterDataByDateRange(
                currentDrillData.dates, 
                currentDrillData.flow, 
                startDate, 
                endDate
            );
            
            // 更新图表
            updateCharts(pressureData, concentrationData, flowData);
            
            // 更新表格
            updateDataTable(drillId, currentDrillData, pressureData, concentrationData, flowData);
            
            // 更新指标卡
            updateMetrics(
                pressureData.data, 
                concentrationData.data, 
                flowData.data, 
                currentDrillData.concentration
            );
            
            // 更新高浓度钻孔表格
            updateHighConcentrationTable();
            
            // 更新超限钻孔计数
            const todayHighDrills = getTodayHighConcentrationDrills();
            exceedCountElement.textContent = todayHighDrills.length;
        }
        
        // 更新指标卡
        function updateMetrics(pressures, concentrations, flows, allConcentrations) {
            if (pressures.length === 0) {
                document.querySelectorAll('.metric-value').forEach(el => {
                    el.textContent = '无数据';
                });
                return;
            }
            
            // 计算平均值
            const avgPressure = (pressures.reduce((a, b) => a + b, 0) / pressures.length).toFixed(2);
            const avgConcentration = (concentrations.reduce((a, b) => a + b, 0) / concentrations.length).toFixed(2);
            const avgFlow = (flows.reduce((a, b) => a + b, 0) / flows.length).toFixed(3);
            
            // 计算始抽浓度（第一次检测浓度）
            const initialConcentration = allConcentrations[0].toFixed(2);
            
            // 计算最高浓度
            const maxConcentration = Math.max(...allConcentrations).toFixed(2);
            
            // 计算最低浓度
            const minConcentration = Math.min(...allConcentrations).toFixed(2);
            
            // 更新指标卡
            document.querySelector('.metric-box:nth-child(1) .metric-value').textContent = `${avgPressure} KPa`;
            document.querySelector('.metric-box:nth-child(2) .metric-value').textContent = `${avgConcentration}%`;
            document.querySelector('.metric-box:nth-child(3) .metric-value').textContent = `${avgFlow} m³/min`;
            document.querySelector('.metric-box:nth-child(4) .metric-value').textContent = `${initialConcentration}%`;
            document.querySelector('.metric-box:nth-child(5) .metric-value').textContent = `${maxConcentration}%`;
            document.querySelector('.metric-box:nth-child(6) .metric-value').textContent = `${minConcentration}%`;
        }
        
        // 更新表格
        function updateDataTable(drillId, drillInfo, pressureData, concentrationData, flowData) {
            // 清空表格
            dataTableBody.innerHTML = '';
            
            if (pressureData.dates.length === 0) {
                const row = document.createElement('tr');
                row.innerHTML = `<td colspan="8" style="text-align: center; padding: 30px;">在选定日期范围内没有找到数据</td>`;
                dataTableBody.appendChild(row);
                return;
            }
            
            // 填充表格
            for (let i = 0; i < pressureData.dates.length; i++) {
                const row = document.createElement('tr');
                
                // 如果瓦斯浓度超过85%，添加高亮样式
                if (concentrationData.data[i] > 85) {
                    row.classList.add('highlight-row');
                }
                
                row.innerHTML = `
                    <td>${pressureData.dates[i]}</td>
                    <td>${drillId}</td>
                    <td>${drillInfo.azimuth.toFixed(1)}</td>
                    <td>${drillInfo.dip.toFixed(1)}</td>
                    <td>${drillInfo.depth.toFixed(1)}</td>
                    <td>${pressureData.data[i].toFixed(2)}</td>
                    <td>${concentrationData.data[i].toFixed(2)}</td>
                    <td>${flowData.data[i].toFixed(3)}</td>
                `;
                dataTableBody.appendChild(row);
            }
        }
        
        // 更新高浓度钻孔表格
        function updateHighConcentrationTable() {
            // 清空表格
            highConcentrationTableBody.innerHTML = '';
            
            // 获取今日高浓度钻孔
            const highConcentrationDrills = getTodayHighConcentrationDrills();
            
            if (highConcentrationDrills.length === 0) {
                const row = document.createElement('tr');
                row.innerHTML = `<td colspan="4" style="text-align: center; padding: 30px;">今日没有发现瓦斯浓度超过30%的钻孔</td>`;
                highConcentrationTableBody.appendChild(row);
                return;
            }
            
            // 填充表格
            highConcentrationDrills.forEach(drill => {
                const row = document.createElement('tr');
                
                // 根据浓度级别添加状态标签
                let statusClass = '';
                let statusText = '';
                if (drill.concentration > 85) {
                    statusClass = 'status-danger';
                    statusText = '严重超标';
                } else if (drill.concentration > 60) {
                    statusClass = 'status-warning';
                    statusText = '超标';
                } else {
                    statusClass = 'status-normal';
                    statusText = '较高';
                }
                
                row.innerHTML = `
                    <td><span class="red-text">${drill.drillId}</span></td>
                    <td>${drill.concentration.toFixed(2)}%</td>
                    <td>${drill.date}</td>
                    <td><span class="status-tag ${statusClass}">${statusText}</span></td>
                `;
                highConcentrationTableBody.appendChild(row);
            });
        }
        
        // 更新图表
        function updateCharts(pressureData, concentrationData, flowData) {
            // 获取Canvas上下文
            const ctx1 = document.getElementById('pressure-chart').getContext('2d');
            const ctx2 = document.getElementById('concentration-chart').getContext('2d');
            const ctx3 = document.getElementById('flow-chart').getContext('2d');
            
            // 销毁旧图表（如果存在）
            if (pressureChart) pressureChart.destroy();
            if (concentrationChart) concentrationChart.destroy();
            if (flowChart) flowChart.destroy();
            
            // 创建新图表
            pressureChart = new Chart(ctx1, {
                type: 'line',
                data: {
                    labels: pressureData.dates,
                    datasets: [{
                        label: '负压 (KPa)',
                        data: pressureData.data,
                        borderColor: '#e74c3c',
                        backgroundColor: 'rgba(231, 76, 60, 0.1)',
                        borderWidth: 3,
                        pointRadius: 5,
                        pointBackgroundColor: '#fff',
                        pointBorderWidth: 2,
                        tension: 0.2,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        },
                        tooltip: {
                            backgroundColor: 'rgba(44, 62, 80, 0.9)',
                            titleFont: {
                                size: 15
                            },
                            bodyFont: {
                                size: 14
                            },
                            padding: 12,
                            displayColors: false
                        }
                    },
                    scales: {
                        x: {
                            grid: {
                                display: false
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        },
                        y: {
                            beginAtZero: false,
                            title: {
                                display: true,
                                text: 'KPa',
                                font: {
                                    size: 14,
                                    weight: 'bold'
                                },
                                color: '#f0f0f0'
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.05)'
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        }
                    },
                    interaction: {
                        mode: 'index',
                        intersect: false
                    },
                    animation: {
                        duration: 1000,
                        easing: 'easeOutQuart'
                    }
                }
            });
            
            concentrationChart = new Chart(ctx2, {
                type: 'line',
                data: {
                    labels: concentrationData.dates,
                    datasets: [{
                        label: '瓦斯浓度 (%)',
                        data: concentrationData.data,
                        borderColor: '#3498db',
                        backgroundColor: 'rgba(52, 152, 219, 0.1)',
                        borderWidth: 3,
                        pointRadius: 5,
                        pointBackgroundColor: '#fff',
                        pointBorderWidth: 2,
                        tension: 0.2,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        },
                        tooltip: {
                            backgroundColor: 'rgba(44, 62, 80, 0.9)',
                            titleFont: {
                                size: 15
                            },
                            bodyFont: {
                                size: 14
                            },
                            padding: 12,
                            displayColors: false
                        },
                        annotation: {
                            annotations: {
                                line1: {
                                    type: 'line',
                                    yMin: 85,
                                    yMax: 85,
                                    borderColor: 'rgba(231, 76, 60, 0.7)',
                                    borderWidth: 2,
                                    borderDash: [5, 5],
                                    label: {
                                        display: true,
                                        content: '严重超标警戒线',
                                        position: 'end',
                                        backgroundColor: 'rgba(231, 76, 60, 0.7)'
                                    }
                                },
                                line2: {
                                    type: 'line',
                                    yMin: 30,
                                    yMax: 30,
                                    borderColor: 'rgba(241, 196, 15, 0.7)',
                                    borderWidth: 2,
                                    borderDash: [5, 5],
                                    label: {
                                        display: true,
                                        content: '警戒线',
                                        position: 'end',
                                        backgroundColor: 'rgba(241, 196, 15, 0.7)'
                                    }
                                }
                            }
                        }
                    },
                    scales: {
                        x: {
                            grid: {
                                display: false
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        },
                        y: {
                            beginAtZero: false,
                            suggestedMin: 0,
                            title: {
                                display: true,
                                text: '%',
                                font: {
                                    size: 14,
                                    weight: 'bold'
                                },
                                color: '#f0f0f0'
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.05)'
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        }
                    },
                    interaction: {
                        mode: 'index',
                        intersect: false
                    },
                    animation: {
                        duration: 1000,
                        easing: 'easeOutQuart'
                    }
                }
            });
            
            flowChart = new Chart(ctx3, {
                type: 'line',
                data: {
                    labels: flowData.dates,
                    datasets: [{
                        label: '混合流量 (m³/min)',
                        data: flowData.data,
                        borderColor: '#2ecc71',
                        backgroundColor: 'rgba(46, 204, 113, 0.1)',
                        borderWidth: 3,
                        pointRadius: 5,
                        pointBackgroundColor: '#fff',
                        pointBorderWidth: 2,
                        tension: 0.2,
                        fill: true
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            display: false
                        },
                        tooltip: {
                            backgroundColor: 'rgba(44, 62, 80, 0.9)',
                            titleFont: {
                                size: 15
                            },
                            bodyFont: {
                                size: 14
                            },
                            padding: 12,
                            displayColors: false
                        }
                    },
                    scales: {
                        x: {
                            grid: {
                                display: false
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        },
                        y: {
                            beginAtZero: false,
                            title: {
                                display: true,
                                text: 'm³/min',
                                font: {
                                    size: 14,
                                    weight: 'bold'
                                },
                                color: '#f0f0f0'
                            },
                            grid: {
                                color: 'rgba(255, 255, 255, 0.05)'
                            },
                            ticks: {
                                color: '#a0a0a0'
                            }
                        }
                    },
                    interaction: {
                        mode: 'index',
                        intersect: false
                    },
                    animation: {
                        duration: 1000,
                        easing: 'easeOutQuart'
                    }
                }
            });
        }
        
        // 页面加载时初始化
        window.addEventListener('load', initializePage);
    </script>
</body>
</html>